package Week4.J0509;

import java.util.Scanner;

public class 添加字符_xv {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        char[] s1 = scanner.next().toCharArray();
        char[] s2 = scanner.next().toCharArray();

        int n = s1.length; int m = s2.length;
        int ret = 100;

        for (int i = 0; i <= m - n; i++) {
            int tmp = 0;
            for (int j = 0; j < n; j++) {
                if (s1[j] != s2[i + j]) {
                    tmp++;
                }
            }
            ret = Math.min(tmp, ret);
        }
        System.out.println(ret);
    }
}
